﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TlToolCordCreate.Mode
{
    /// <summary>
    /// 添加业务代码参数
    /// </summary>
    public class AddCodeGenInput : CodeGenInput
    {
        /// <summary>
        /// 数据库表名
        /// </summary>
        [Required(ErrorMessage = "数据库表名不能为空")]
        public override string TableName { get; set; }

        /// <summary>
        /// 业务名（业务代码包名称）
        /// </summary>
        [Required(ErrorMessage = "业务名不能为空")]
        public override string BusName { get; set; }

        /// <summary>
        /// 命名空间
        /// </summary>
        [Required(ErrorMessage = "命名空间不能为空")]
        public override string NameSpace { get; set; }

        /// <summary>
        /// 作者姓名
        /// </summary>
        [Required(ErrorMessage = "作者姓名不能为空")]
        public override string AuthorName { get; set; }

        ///// <summary>
        ///// 类名
        ///// </summary>
        //[Required(ErrorMessage = "类名不能为空")]
        //public override string ClassName { get; set; }

        ///// <summary>
        ///// 是否移除表前缀
        ///// </summary>
        //[Required(ErrorMessage = "是否移除表前缀不能为空")]
        //public override string TablePrefix { get; set; }

        /// <summary>
        /// 生成方式
        /// </summary>
        [Required(ErrorMessage = "生成方式不能为空")]
        public override string GenerateType { get; set; }

        ///// <summary>
        ///// 功能名（数据库表名称）
        ///// </summary>
        //[Required(ErrorMessage = "数据库表名不能为空")]
        //public override string TableComment { get; set; }

        /// <summary>
        /// 菜单父级
        /// </summary>
        [Required(ErrorMessage = "菜单父级不能为空")]
        public override long MenuPid { get; set; }
    }
    /// <summary>
    /// 代码生成参数类
    /// </summary>
    public class CodeGenInput : BasePageInput
    {
        /// <summary>
        /// 作者姓名
        /// </summary>
        public virtual string AuthorName { get; set; }

        /// <summary>
        /// 类名
        /// </summary>
        public virtual string ClassName { get; set; }

        /// <summary>
        /// 是否移除表前缀
        /// </summary>
        public virtual string TablePrefix { get; set; }

        /// <summary>
        /// 库定位器名
        /// </summary>
        public virtual string ConfigId { get; set; }

        /// <summary>
        /// 数据库名(保留字段)
        /// </summary>
        public virtual string DbName { get; set; }

        /// <summary>
        /// 数据库类型
        /// </summary>
        public virtual string DbType { get; set; }

        /// <summary>
        /// 数据库链接
        /// </summary>
        public virtual string ConnectionString { get; set; }

        /// <summary>
        /// 生成方式
        /// </summary>
        public virtual string GenerateType { get; set; }

        /// <summary>
        /// 数据库表名
        /// </summary>
        public virtual string TableName { get; set; }

        /// <summary>
        /// 命名空间
        /// </summary>
        public virtual string NameSpace { get; set; }

        /// <summary>
        /// 业务名（业务代码包名称）
        /// </summary>
        public virtual string BusName { get; set; }

        /// <summary>
        /// 功能名（数据库表名称）
        /// </summary>
        public virtual string TableComment { get; set; }

        /// <summary>
        /// 菜单应用分类（应用编码）
        /// </summary>
        public virtual string MenuApplication { get; set; }

        /// <summary>
        /// 菜单父级
        /// </summary>
        public virtual long MenuPid { get; set; }

        /// <summary>
        /// 支持打印类型
        /// </summary>
        public virtual string PrintType { get; set; }

        /// <summary>
        /// 打印模版名称
        /// </summary>
        public virtual string PrintName { get; set; }
    }
    /// <summary>
    /// 全局分页查询输入参数
    /// </summary>
    public class BasePageInput
    {
        /// <summary>
        /// 当前页码
        /// </summary>
        public virtual int Page { get; set; } = 1;

        /// <summary>
        /// 页码容量
        /// </summary>
        //[Range(0, 100, ErrorMessage = "页码容量超过最大限制")]
        public virtual int PageSize { get; set; } = 20;

        /// <summary>
        /// 排序字段
        /// </summary>
        public virtual string Field { get; set; }

        /// <summary>
        /// 排序方向
        /// </summary>
        public virtual string Order { get; set; }

        /// <summary>
        /// 降序排序
        /// </summary>
        public virtual string DescStr { get; set; } = "descending";
    }
}
